#pragma once
#include"HashTable.h"
namespace wjx {

	template<class K, class Hash = HashFunc<K>>
	class unorderedSet {
	public:
		typedef K T;
		typedef K K;

		struct SetKeyofT {
			const K& operator()(const K& t) {
				return t;
			}
		};
			typedef typename  wjx::HashTable<K,const T, SetKeyofT, Hash>::Iterator iterator;
			typedef typename wjx::HashTable<K,const T, SetKeyofT, Hash>::ConstIterator const_iterator;

			iterator begin()
			{
				return _ht.Begin();
			}
			iterator end()
			{
				return _ht.End();
			}
			const_iterator begin()const
			{
				return _ht.Begin();
			}
			const_iterator end()const
			{
				return _ht.End();
			}

			pair<iterator, bool> Insert(const T& kv) {
				return _ht.Insert(kv);
			}

			pair<iterator, bool> Find(const K& k) {
				return _ht.Find(k);
			}

			bool Erase(const K& k) {
				return _ht.Erase(k);
			}

		private:
			wjx::HashTable<K,const T, SetKeyofT, Hash> _ht;
		};
	}
